Skip to content

Fix find / being treated as DOS find#150

Merged
DHowett merged 3 commits into
microsoft:mainfrom
a-rookie-of-C-language:fix-149-find-root-path
Jul 21, 2026
Merged

Fix find / being treated as DOS find#150
DHowett merged 3 commits into
microsoft:mainfrom
a-rookie-of-C-language:fix-149-find-root-path

Conversation

@a-rookie-of-C-language

@a-rookie-of-C-language a-rookie-of-C-language commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Closes #149

Comment thread src/nthelpers.rs
let Some((first, mut rest)) = next_raw_find_token(rest) else {
return Flavor::Ambiguous;
};
if is_dos_find_switch(first.raw) || first.raw.first().is_some_and(|&c| c == b'/' as u16) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It naively appears to me that simply removing the OR condition here should be enough to fix the issue. Is that not the case?

@a-rookie-of-C-language a-rookie-of-C-language Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right.I'll delete it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lhecker I think we need to add /? to the list of dos find flags, since I think it was previously being caught here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@lhecker lhecker changed the title fix: treat find slash root as GNU find Fix find / being treated as DOS find Jul 21, 2026
@lhecker
lhecker requested a review from DHowett July 21, 2026 14:12
@DHowett
DHowett merged commit 786107b into microsoft:main Jul 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

find command interprets standalone forward slash / as a DOS switch instead of a Unix path

3 participants